import { Meta } from '@storybook/blocks';

import * as SingleChildScrollViewStories from '../stories/SingleChildScrollView.stories';

<Meta of={SingleChildScrollViewStories} />

# SingleChildScrollView

A box in which a single widget can be scrolled.

## Example

```dart liveslice=SingleChildScrollView mockup=iPhone7
Widget build(BuildContext context) {
  return LayoutBuilder(
    builder: (BuildContext context, BoxConstraints viewportConstraints) {
      return SingleChildScrollView(
        child: ConstrainedBox(
          constraints: BoxConstraints(
            minHeight: viewportConstraints.maxHeight,
          ),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: <Widget>[
              Container(
                // A fixed-height child.
                color: const Color(0xff808000), // Yellow
                height: 120.0,
              ),
              Container(
                // Another fixed-height child.
                color: const Color(0xff008000), // Green
                height: 120.0,
              ),
            ],
          ),
        ),
      );
    },
  );
}
```

## Related Links

- https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html
